#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

/**
 * Definition for singly-linked list.
 */
struct ListNode {
	int val;
	struct ListNode* next;
};
typedef struct ListNode listNode, *listnode;

struct ListNode* reverseList(struct ListNode* head);

int main()
{
	return 0;
}

struct ListNode* reverseList(struct ListNode* head)
{
	if (!head) return head;
	listNode aux = { 0, head };

	listnode p = head->next;
	head->next = 0;
	while (p) {
		listnode next = p->next;
		p->next = aux.next;
		aux.next = p;
		p = next;
	}

	return aux.next;
}
